import request from '@/utils/request';

export function getList(query) {
  return request({
    url: '/sysm/user/',
    method: 'get',
    params: query
  });
}

export function getDefaultPwd(query) {
  return request({
    url: '/sysm/user/getDefaultPwd',
    method: 'get',
    params: query
  });
}

export function saveOrUpdate(param) {
  return request.post('/sysm/user/', JSON.stringify(param));
}

export function resetPwd(id) {
  return request({
    url: `/sysm/user/resetPwd/${id}`,
    method: 'get'
  });
}

export function changePwd(param) {
  return request.post('/sysm/user/changePwd', JSON.stringify(param));
}

export function deleteById(id) {
  return request({
    url: `/sysm/user/${id}`,
    method: 'delete'
  });
}

export function deleteByIds(ids) {
  return request({
    url: `/sysm/user/deleteList`,
    method: 'delete',
    params: ids
  });
}
